/*
 * @Author: qsy
 * @Date: 2024-12-28 14:50:37
 * @LastEditors: qsy
 * @LastEditTime: 2024-12-28 15:11:45
 * @Description: spi 头文件
 */
#ifndef _BOARD_SPI_H_
#define _BOARD_SPI_H_

/*********************************************************************
 * INCLUDES
 */
#include <stdint.h>
#include "driver/gpio.h"

/*********************************************************************
 * DEFINITIONS
 */
#define ADXL345_SPI_MISO_PIN        GPIO_NUM_13
#define ADXL345_SPI_MOSI_PIN        GPIO_NUM_12
#define ADXL345_SPI_SCLK_PIN        GPIO_NUM_11
#define ADXL345_SPI_CS_PIN          GPIO_NUM_14

#define DMA_CHAN                	2

#define SPI_CS_LOW              	ADXL345_SPI_CS_Set(0)
#define SPI_CS_HIGH             	ADXL345_SPI_CS_Set(1)

#define SPI_HOST                	SPI2_HOST

/*********************************************************************
 * API FUNCTIONS
 */
void ADXL345_SPI_Init(void);
void ADXL345_SPI_Write(uint8_t *pData, uint32_t dataLen);
void ADXL345_SPI_Read(uint8_t *pData, uint32_t dataLen);
void ADXL345_SPI_CS_Set(uint8_t level);

#endif /* _BOARD_SPI_H_ */
